package com.blockmeta.bbs.businesslibrary.pojo;


public class PageInfo {
    protected int m_nPage = 1;
    protected int m_nQueryCount;
    protected int m_nTotaPage;
    protected boolean m_bNext;
    public final int DEFAULT_COUNT = 20;

    public PageInfo() {
        init(DEFAULT_COUNT);
    }

    public PageInfo(int queryCount) {
        init(queryCount);
    }

    public void init(int queryCount) {
        m_nQueryCount = queryCount;
        reset();
    }


    public int getPage() {
        return m_nPage;
    }

    public int getQueryCount() {
        return m_nQueryCount;
    }

    public int getTotalPage() {
        return m_nTotaPage;

    }

    public void reset() {
        m_bNext = true;
        m_nPage = 1;
        m_nTotaPage = 0;
    }

    public void setPage(int page, int totalPage) {
        m_nPage = page;
        m_nTotaPage = totalPage;
        m_bNext = (page < totalPage);
    }

    public boolean hasNext() {
        return m_bNext;
    }

}
